﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<div id="idobj" style="height:0;">
    <object id="secmgr" codebase="smsx.cab#Version=6,5,439,72" classid="clsid:5445BE81-B796-11D2-B931-002018654E2E" viewastext>
        <param name="GUID" value="{8C605D40-A0B9-CE77-D0C7-3BD0288E9BD6}"/>
        <param name="PATH" value="sxlic.mlf"/>
        <param name="REVISION" value="0" />
        <param name="PerUser" value="true"/ >
    </object>
    <object id="factory" classid="clsid:1663ED61-23EB-11D2-B92F-008048FDD814"  viewastext>
        <param name="template" value="MeadCo://IE7"/>
    </object>
</div> 
<script language="Javascript" type="text/javascript">
    function PrintSetup() {
        document.getElementById("idobj").style.display = "none"; //显示按钮
        factory.printing.printer = "打印机1"; //指定使用的打印机
        factory.printing.paperSize = "MSF"; //指定使用的纸张
        factory.printing.header = "";
        factory.printing.footer = "";
        factory.printing.leftMargin = 0;
        factory.printing.rightMargin = 0;
        factory.printing.topMargin = 0;
        factory.printing.bottomMargin = 0;
    }

    window.onload = function () {
        PrintSetup();
        //factory.printing.Print(true); //无确认打印，true时打印前需进行确认
        var printname = "0";
        var index = 0;
        while (1) {
            if (printname != "" && printname != null) {
                printname = factory.printing.EnumPrinters(index);
                if (printname.indexOf("打印机1") != "-1") {
                    alert(printname);
                    break;
                }
                index++;
            }
            else {
                break;
            }
        }
        window.close(); //关闭窗口
    }

   
</script>
</body>
</html>
